import Vue from 'vue'
import VueRouter, {RouteConfig} from 'vue-router'

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
    {
        path: '/',
        component: ()=> import('@/views/login/loginView.vue'),
        meta: {title: "筋斗外卖",hidden: true, notNeedAuth: true}
    },
    {
        path: '/index',
        component: () => import('../views/dish/index.vue'),
        meta: {title: "首页"}
    },
    {
        path: '/shoppingCart',
        component: () => import('@/views/shoppingcart/index.vue'),
        meta: {title: "我的购物车"}
    },
    {
        path: '/orders',
        component: () => import('@/views/order/index.vue'),
        meta: {title: "我的订单"}
    },
    {
        path: '/success',
        component: () => import('@/components/Success/index.vue'),
        meta: {title: "我的订单"}
    },
    {
        path: '/404',
        component: () => import('@/views/404View.vue'),
        meta: {title: "筋斗外卖",hidden: true, notNeedAuth: true}

    },
    {
        path: '*',
        redirect: '/404'
    }
]

const router = new VueRouter({
    routes
})

export default router
